home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / util / pictcont.sit / PICT Control.rsrc / TEXT_302.txt < prev    next >
Text File  |  1988-11-15  |  456b  |  15 lines

  1. For example, if you wanted to create a control that changes its appearance by cycling through a range of pictures, you would repeatedly call the function below (or a more terse equivalent):
  2.  
  3. {
  4.     int                    Val, Max, Min;
  5.  
  6.     Val = GetCtlValue(ControlHandle);
  7.     Min = GetCtlMin(ControlHandle);
  8.     Max = GetCtlMax(ControlHandle);
  9.  
  10.     Val++;    /* Increment Val to move to the next picture in the series */
  11.     if (Val > Max) 
  12.         Val = Min;
  13.  
  14.     SetCtlValue(ControlHandle, Val);
  15. }